/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.creator.logical.links.сore;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Vector;
import ru.creator.logical.links.сore.util.Log;

/**
 *
 * @author ~jo-MA-jo~
 */
public class MessageСonstructor {
    private Logic logic;
    private Log logger;
    private String SenderID;
    private List<LinkedHashMap <String,Integer>> list = new Vector <LinkedHashMap <String,Integer>>();
    private List<String> historyU = new Vector <String>();//сообщения пользователя
    private List<String> historyB = new Vector <String>();//сообщения бота


    public MessageСonstructor(Logic logic,String SenderID){
        this.logic = logic;
        logger = logic.getLogger();
        this.SenderID = SenderID;
        LinkedHashMap <String,Integer> l = new LinkedHashMap <String,Integer>();
        l.put("привет", 10);
        l.put("дела", 10);
        l.put("как", 10);
        l.put("аавы", 2);
        l.put("псривест", 5);
        l.put("прссивет", 3);
        l.put("прячяивет", 4);
        list.add(l);
    }


    public void addHashWords(LinkedHashMap <String,Integer> l){
        if (l.size()>0){
        list.add(l);
        logger.debug("Добавление коллеции слов");
        }
    }

    public OutMessageEvent getMessage(){
        return getMessage("");
    }

    public OutMessageEvent getMessage(String message){
        if (!"".equals(message))historyU.add(message);


        OutMessageEvent ms = new OutMessageEvent(SenderID,"тест");

        historyB.add(ms.getResponse());
        logger.talkOut(ms.getResponse());
        list.clear();
        return ms;
    }





}
